package com.dm.sevices;

import com.dm.dao.DmItemCinemaSeatMapper;
import com.dm.pojo.DmItemCinemaSeat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by dm
 */
@RestController
public class RestDmItemCinemaSeatService {

     @Autowired
     private DmItemCinemaSeatMapper dmItemCinemaSeatMapper;

     @RequestMapping(value = "/getDmItemCinemaSeatById",method = RequestMethod.POST)
     public DmItemCinemaSeat getDmItemCinemaSeatById(@RequestParam("id") Long id)throws Exception{
        return dmItemCinemaSeatMapper.getDmItemCinemaSeatById(id);
     }

     @RequestMapping(value = "/getDmItemCinemaSeatListByMap",method = RequestMethod.POST)
     public List<DmItemCinemaSeat>	getDmItemCinemaSeatListByMap(@RequestParam Map<String,Object> param)throws Exception{
        return dmItemCinemaSeatMapper.getDmItemCinemaSeatListByMap(param);
     }

     @RequestMapping(value = "/getDmItemCinemaSeatCountByMap",method = RequestMethod.POST)
     public Integer getDmItemCinemaSeatCountByMap(@RequestParam Map<String,Object> param)throws Exception{
        return dmItemCinemaSeatMapper.getDmItemCinemaSeatCountByMap(param);
     }

     @RequestMapping(value = "/qdtxAddDmItemCinemaSeat",method = RequestMethod.POST)
     public Integer qdtxAddDmItemCinemaSeat(@RequestBody DmItemCinemaSeat dmItemCinemaSeat)throws Exception{
        dmItemCinemaSeat.setCreatedTime(new Date());
        return dmItemCinemaSeatMapper.insertDmItemCinemaSeat(dmItemCinemaSeat);
     }

     @RequestMapping(value = "/qdtxModifyDmItemCinemaSeat",method = RequestMethod.POST)
     public Integer qdtxModifyDmItemCinemaSeat(@RequestBody DmItemCinemaSeat dmItemCinemaSeat)throws Exception{
        dmItemCinemaSeat.setUpdatedTime(new Date());
        return dmItemCinemaSeatMapper.updateDmItemCinemaSeat(dmItemCinemaSeat);
     }
}
